<!-- 头部 -->
<include file="Public:header" />

<!-- 资料认证  侧边/头部 -->
<include file="Public:zlrz_header" />


            <div style="height: 976px;" class="nav-a-settings" id="navconfig">
                <ul style="top: 0px;">
                    <li data-nav="showI2">
                        <a href="{:U('jiazhang/head',array('newcity'=>$city))}"><span class="sp3">&nbsp;</span>头像</a>
                    </li>
                    <li data-nav="showI4">
                        <a href="{:U('jiazhang/jiazhang_one',array('newcity'=>$city))}"><span class="sp5">&nbsp;</span>学员信息</a>
                    </li>
                     <li data-nav="showI4">
                        <a href="{:U('jiazhang/jiazhang_info',array('newcity'=>$city))}" class="active"><span class="sp5">&nbsp;</span>学生信息</a>
                    </li>
                    <li data-nav="showI0">
                        <a href="{:U('jiazhang/password',array('newcity'=>$city))}"><span class="sp1">&nbsp;</span>账号及密码</a>
                    </li>
                </ul>
            </div>
            <div style="height: 976px;" class="wfor365hls">
                <div class="content-a-settings zlrz" id="CoF1">
                <form class="layui-form" method="post">
                    <div class="lrem x-o" id="tab-identitycard">
                        <div class="o0o desc-F60">
                            温馨提示：以下带号的是必填项。老师上门郑重为您承诺，我们会加密保护您的个人信息。
                        </div>
                        <div class="o0o cLr editing remo_overflow">
                            <span class="skkm">
                                <label class="star" style="width: 128px;">上课区域<font color="#FF0000">(必选)</font>：</label>
                            </span>
                            <div class="T-subject downlist-subject ">
                                <div class="T-subject downlist-subject112">                    
                                    <select name="quyu" required lay-verify="required" style="width:135px">
                                        <option value="" selected=""> - 选择 {$jiazhang_info.sk_quyu}- </option>
                                        <?php foreach ($city_quyu as $k) { ?>
                                            <option value="{$k.city_name}">{$k.city_name}<option>
                                        <?php } ?>
                                    </select>
                                </div>
                           </div>
                        </div>
                        <div class="o0o cLr editing">
                            <span class="title-o0o">
                                <label class="star" style="width: 128px;">学生姓名：</label>
                            </span>
                            <div class="input-tips">
                                <input type="text" name="name" required lay-verify="required" placeholder="请填写学生姓名" class="pub" value="{$jiazhang_info.name}">
                            </div>
                        </div>

                        <div class="o0o cLr editing">
                            <span class="title-o0o"> 
                                <label class="star" style="width: 128px;">学生性别：</label>
                            </span>
                            <div class="input-tips">
                            <?php if ($jiazhang_info['sex'] == '男') { ?>
                                <input type="radio" name="sex" value="男" checked="" title="男">
                                <input type="radio" name="sex" value="女" title="女">
                            <?php }else { ?>
                                <input type="radio" name="sex" value="男" title="男">
                                <input type="radio" name="sex" value="女" checked="" title="女">
                            <?php } ?>
                            </div>
                        </div>
                        <div class="o0o cLr editing remo_overflow">
                            <span class="skkm">
                                <label class="star" style="width: 128px;">上课年级<font color="#FF0000">(必选)</font>：</label>
                            </span>
                            <div class="T-subject downlist-subject ">
                                <div class="T-subject downlist-subject112">                    
                                    <select name="grade" required lay-verify="required" style="width:135px">
                                        <option value="" selected=""> - 选择 {$jiazhang_info.grade} - </option>
                                    <?php foreach ($grade_info as $c) { ?>
                                        <option value="{$c.grade_name}">{$c.grade_name}</option>
                                    <?php } ?>
                                    </select>
                                </div>
                           </div>
                        </div>

                        <div class="o0o cLr editing po-re">
                            <span class="title-o0o skkm">
                                <label class="star po-re" style="width: 128px;">补习科目：<i>(支持多选)</i></label>
                            </span>
                            <div class="fl sel_teach" id="radioArea">
                                <div class="o0o cLr" name="Radioit">
                                    <span class="title-o0o">
                                    <?php foreach ($kecheng as $k) { ?>
                                        <input type="checkbox" class="kecheng" name="kecheng" value="{$k.id}"<?php if (in_array($k['id'], $subjects)) { ?>
                                          checked
                                        <?php } ?>>{$k.name}
                                    <?php } ?>
                                    </span>
                                </div>
                             </div>
                        </div>
                        <input type="hidden" name="sk_city" value="{$city_name}">
                      <button class="layui-btn layui-btn-warm" lay-filter="*" lay-submit style="position: absolute; left: 80%;background-color: #30c76c;">保存</button>   
                </div>
                </form>
            </div>
        </div>
<script type="text/javascript">
    layui.use(['form','layer'], function(){
      var layer = layui.layer
      ,form = layui.form();
      //layer.msg('Hello World');


      //交互
    form.on('submit(*)', function(data){
        //捉到所有被选中的，发异步进行删除
        //上门方式
        var kecheng = new Array();
        var chenked=$(".kecheng:checked").each(function(){
           kecheng.push($(this).val()); 
        })
        data.field.kecheng = kecheng;
      //console.log(arr);
        $.ajax({
            url: "{:U('jiazhang/jiazhang_info_add')}",//请求地址
            type: "post",//请求方式
            dataType: "json",//返回数据类型
            data: data.field,//发送的参数
            })
            .done(function(response) {
                  if(response.error==0){
                     layer.msg(response.info ,{icon:5});

                  }else{
                     layer.msg(response.info ,{icon:6});
                     location.reload();

                  }
              })
            .fail(function() {
                alert("ajxs交互失败");
            })  

          return false; //阻止表单跳转。如果需要表单跳转，去掉这段即可。
        });   

    });
</script>
</html>